home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / Components.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  19.0 KB  |  560 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Components.h
  3.  
  4.      Contains:    Component Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1991-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COMPONENTS__
  18. #define __COMPONENTS__
  19.  
  20. #ifndef __ERRORS__
  21. #include <Errors.h>
  22. #endif
  23. #ifndef __MACTYPES__
  24. #include <MacTypes.h>
  25. #endif
  26. #ifndef __MIXEDMODE__
  27. #include <MixedMode.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52.  
  53. enum {
  54.     kAppleManufacturer            = FOUR_CHAR_CODE('appl'),        /* Apple supplied components */
  55.     kComponentResourceType        = FOUR_CHAR_CODE('thng'),        /* a components resource type */
  56.     kComponentAliasResourceType    = FOUR_CHAR_CODE('thga')        /* component alias resource type */
  57. };
  58.  
  59.  
  60. enum {
  61.     kAnyComponentType            = 0,
  62.     kAnyComponentSubType        = 0,
  63.     kAnyComponentManufacturer    = 0,
  64.     kAnyComponentFlagsMask        = 0
  65. };
  66.  
  67.  
  68. enum {
  69.     cmpWantsRegisterMessage        = 1L << 31
  70. };
  71.  
  72.  
  73. enum {
  74.     kComponentOpenSelect        = -1,                            /* ComponentInstance for this open */
  75.     kComponentCloseSelect        = -2,                            /* ComponentInstance for this close */
  76.     kComponentCanDoSelect        = -3,                            /* selector # being queried */
  77.     kComponentVersionSelect        = -4,                            /* no params */
  78.     kComponentRegisterSelect    = -5,                            /* no params */
  79.     kComponentTargetSelect        = -6,                            /* ComponentInstance for top of call chain */
  80.     kComponentUnregisterSelect    = -7,                            /* no params */
  81.     kComponentGetMPWorkFunctionSelect = -8                        /* some params */
  82. };
  83.  
  84. /* Component Resource Extension flags */
  85.  
  86. enum {
  87.     componentDoAutoVersion        = (1 << 0),
  88.     componentWantsUnregister    = (1 << 1),
  89.     componentAutoVersionIncludeFlags = (1 << 2),
  90.     componentHasMultiplePlatforms = (1 << 3),
  91.     componentLoadResident        = (1 << 4)
  92. };
  93.  
  94.  
  95.  
  96. /* Set Default Component flags */
  97.  
  98. enum {
  99.     defaultComponentIdentical    = 0,
  100.     defaultComponentAnyFlags    = 1,
  101.     defaultComponentAnyManufacturer = 2,
  102.     defaultComponentAnySubType    = 4,
  103.     defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
  104.     defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
  105. };
  106.  
  107. /* RegisterComponentResource flags */
  108.  
  109. enum {
  110.     registerComponentGlobal        = 1,
  111.     registerComponentNoDuplicates = 2,
  112.     registerComponentAfterExisting = 4,
  113.     registerComponentAliasesOnly = 8
  114. };
  115.  
  116.  
  117.  
  118. struct ComponentDescription {
  119.     OSType                             componentType;                /* A unique 4-byte code indentifying the command set */
  120.     OSType                             componentSubType;            /* Particular flavor of this instance */
  121.     OSType                             componentManufacturer;        /* Vendor indentification */
  122.     unsigned long                     componentFlags;                /* 8 each for Component,Type,SubType,Manuf/revision */
  123.     unsigned long                     componentFlagsMask;            /* Mask for specifying which flags to consider in search, zero during registration */
  124. };
  125. typedef struct ComponentDescription        ComponentDescription;
  126.  
  127.  
  128. struct ResourceSpec {
  129.     OSType                             resType;                    /* 4-byte code  */
  130.     short                             resID;                        /*              */
  131. };
  132. typedef struct ResourceSpec                ResourceSpec;
  133.  
  134. struct ComponentResource {
  135.     ComponentDescription             cd;                            /* Registration parameters */
  136.     ResourceSpec                     component;                    /* resource where Component code is found */
  137.     ResourceSpec                     componentName;                /* name string resource */
  138.     ResourceSpec                     componentInfo;                /* info string resource */
  139.     ResourceSpec                     componentIcon;                /* icon resource */
  140. };
  141. typedef struct ComponentResource        ComponentResource;
  142. typedef ComponentResource *                ComponentResourcePtr;
  143. typedef ComponentResourcePtr *            ComponentResourceHandle;
  144.  
  145. struct ComponentPlatformInfo {
  146.     long                             componentFlags;                /* flags of Component */
  147.     ResourceSpec                     component;                    /* resource where Component code is found */
  148.     short                             platformType;                /* gestaltSysArchitecture result */
  149. };
  150. typedef struct ComponentPlatformInfo    ComponentPlatformInfo;
  151.  
  152. struct ComponentResourceExtension {
  153.     long                             componentVersion;            /* version of Component */
  154.     long                             componentRegisterFlags;        /* flags for registration */
  155.     short                             componentIconFamily;        /* resource id of Icon Family */
  156. };
  157. typedef struct ComponentResourceExtension ComponentResourceExtension;
  158.  
  159. struct ComponentPlatformInfoArray {
  160.     long                             count;
  161.     ComponentPlatformInfo             platformArray[1];
  162. };
  163. typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
  164.  
  165. struct ExtComponentResource {
  166.     ComponentDescription             cd;                            /* registration parameters */
  167.     ResourceSpec                     component;                    /* resource where Component code is found */
  168.     ResourceSpec                     componentName;                /* name string resource */
  169.     ResourceSpec                     componentInfo;                /* info string resource */
  170.     ResourceSpec                     componentIcon;                /* icon resource */
  171.     long                             componentVersion;            /* version of Component */
  172.     long                             componentRegisterFlags;        /* flags for registration */
  173.     short                             componentIconFamily;        /* resource id of Icon Family */
  174.     long                             count;                        /* elements in platformArray */
  175.     ComponentPlatformInfo             platformArray[1];
  176. };
  177. typedef struct ExtComponentResource        ExtComponentResource;
  178.  
  179. struct ComponentAliasResource {
  180.     ComponentResource                 cr;                            /* Registration parameters */
  181.     ComponentDescription             aliasCD;                    /* component alias description */
  182. };
  183. typedef struct ComponentAliasResource    ComponentAliasResource;
  184. /*  Structure received by Component:        */
  185.  
  186. struct ComponentParameters {
  187.     UInt8                             flags;                        /* call modifiers: sync/async, deferred, immed, etc */
  188.     UInt8                             paramSize;                    /* size in bytes of actual parameters passed to this call */
  189.     short                             what;                        /* routine selector, negative for Component management calls */
  190.     long                             params[1];                    /* actual parameters for the indicated routine */
  191. };
  192. typedef struct ComponentParameters        ComponentParameters;
  193.  
  194. struct ComponentRecord {
  195.     long                             data[1];
  196. };
  197. typedef struct ComponentRecord            ComponentRecord;
  198.  
  199. typedef ComponentRecord *                Component;
  200.  
  201. struct ComponentInstanceRecord {
  202.     long                             data[1];
  203. };
  204. typedef struct ComponentInstanceRecord    ComponentInstanceRecord;
  205.  
  206. typedef ComponentInstanceRecord *        ComponentInstance;
  207.  
  208. struct RegisteredComponentRecord {
  209.     long                             data[1];
  210. };
  211. typedef struct RegisteredComponentRecord RegisteredComponentRecord;
  212.  
  213. struct RegisteredComponentInstanceRecord {
  214.     long                             data[1];
  215. };
  216. typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
  217. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
  218.  
  219. typedef long                             ComponentResult;
  220.  
  221. enum {
  222.     platform68k                    = 1,                            /* platform type (response from gestaltSysArchitecture) */
  223.     platformPowerPC                = 2,
  224.     platformInterpreted            = 3,
  225.     platformWin32                = 4
  226. };
  227.  
  228.  
  229. enum {
  230.     mpWorkFlagDoWork            = (1 << 0),
  231.     mpWorkFlagDoCompletion        = (1 << 1),
  232.     mpWorkFlagCopyWorkBlock        = (1 << 2),
  233.     mpWorkFlagDontBlock            = (1 << 3),
  234.     mpWorkFlagGetProcessorCount    = (1 << 4),
  235.     mpWorkFlagGetIsRunning        = (1 << 6)
  236. };
  237.  
  238.  
  239. struct ComponentMPWorkFunctionHeaderRecord {
  240.     UInt32                             headerSize;
  241.     UInt32                             recordSize;
  242.     UInt32                             workFlags;
  243.     UInt16                             processorCount;
  244.     UInt8                             unused;
  245.     UInt8                             isRunning;
  246. };
  247. typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
  248. typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
  249. typedef CALLBACK_API( ComponentResult , ComponentMPWorkFunctionProcPtr )(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
  250. typedef CALLBACK_API( ComponentResult , ComponentRoutineProcPtr )(ComponentParameters *cp, Handle componentStorage);
  251. typedef STACK_UPP_TYPE(ComponentMPWorkFunctionProcPtr)             ComponentMPWorkFunctionUPP;
  252. typedef STACK_UPP_TYPE(ComponentRoutineProcPtr)                 ComponentRoutineUPP;
  253. /*
  254.     The parameter list for each ComponentFunction is unique. It is
  255.     therefore up to users to create the appropriate procInfo for their
  256.     own ComponentFunctions where necessary.
  257. */
  258.  
  259. typedef UniversalProcPtr                 ComponentFunctionUPP;
  260. #if TARGET_RT_MAC_CFM
  261. /* 
  262.     CallComponentUPP is a global variable exported from InterfaceLib.
  263.     It is the ProcPtr passed to CallUniversalProc to manually call a component function.
  264. */
  265. extern UniversalProcPtr CallComponentUPP;
  266. #endif
  267.  
  268. #define ComponentCallNow( callNumber, paramSize ) \
  269.     FIVEWORDINLINE( 0x2F3C,paramSize,callNumber,0x7000,0xA82A )
  270.  
  271. /********************************************************
  272. *                                                        *
  273. *                  APPLICATION LEVEL CALLS                    *
  274. *                                                        *
  275. ********************************************************/
  276. /********************************************************
  277. * Component Database Add, Delete, and Query Routines
  278. ********************************************************/
  279. EXTERN_API( Component )
  280. RegisterComponent                (ComponentDescription *    cd,
  281.                                  ComponentRoutineUPP     componentEntryPoint,
  282.                                  short                     global,
  283.                                  Handle                 componentName,
  284.                                  Handle                 componentInfo,
  285.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7001, 0xA82A);
  286.  
  287. EXTERN_API( Component )
  288. RegisterComponentResource        (ComponentResourceHandle  cr,
  289.                                  short                     global)                                TWOWORDINLINE(0x7012, 0xA82A);
  290.  
  291. EXTERN_API( OSErr )
  292. UnregisterComponent                (Component                 aComponent)                            TWOWORDINLINE(0x7002, 0xA82A);
  293.  
  294. EXTERN_API( Component )
  295. FindNextComponent                (Component                 aComponent,
  296.                                  ComponentDescription *    looking)                            TWOWORDINLINE(0x7004, 0xA82A);
  297.  
  298. EXTERN_API( long )
  299. CountComponents                    (ComponentDescription *    looking)                            TWOWORDINLINE(0x7003, 0xA82A);
  300.  
  301. EXTERN_API( OSErr )
  302. GetComponentInfo                (Component                 aComponent,
  303.                                  ComponentDescription *    cd,
  304.                                  Handle                 componentName,
  305.                                  Handle                 componentInfo,
  306.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7005, 0xA82A);
  307.  
  308. EXTERN_API( long )
  309. GetComponentListModSeed            (void)                                                        TWOWORDINLINE(0x7006, 0xA82A);
  310.  
  311. EXTERN_API( long )
  312. GetComponentTypeModSeed            (OSType                 componentType)                        TWOWORDINLINE(0x702C, 0xA82A);
  313.  
  314. /********************************************************
  315. * Component Instance Allocation and dispatch routines
  316. ********************************************************/
  317. EXTERN_API( OSErr )
  318. OpenAComponent                    (Component                 aComponent,
  319.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702D, 0xA82A);
  320.  
  321. EXTERN_API( ComponentInstance )
  322. OpenComponent                    (Component                 aComponent)                            TWOWORDINLINE(0x7007, 0xA82A);
  323.  
  324. EXTERN_API( OSErr )
  325. CloseComponent                    (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x7008, 0xA82A);
  326.  
  327. EXTERN_API( OSErr )
  328. GetComponentInstanceError        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700A, 0xA82A);
  329.  
  330. /********************************************************
  331. *                                                        *
  332. *                      CALLS MADE BY COMPONENTS              *
  333. *                                                        *
  334. ********************************************************/
  335. /********************************************************
  336. * Component Management routines
  337. ********************************************************/
  338. EXTERN_API( void )
  339. SetComponentInstanceError        (ComponentInstance         aComponentInstance,
  340.                                  OSErr                     theError)                            TWOWORDINLINE(0x700B, 0xA82A);
  341.  
  342. EXTERN_API( long )
  343. GetComponentRefcon                (Component                 aComponent)                            TWOWORDINLINE(0x7010, 0xA82A);
  344.  
  345. EXTERN_API( void )
  346. SetComponentRefcon                (Component                 aComponent,
  347.                                  long                     theRefcon)                            TWOWORDINLINE(0x7011, 0xA82A);
  348.  
  349. EXTERN_API( short )
  350. OpenComponentResFile            (Component                 aComponent)                            TWOWORDINLINE(0x7015, 0xA82A);
  351.  
  352. EXTERN_API( OSErr )
  353. OpenAComponentResFile            (Component                 aComponent,
  354.                                  short *                resRef)                                TWOWORDINLINE(0x702F, 0xA82A);
  355.  
  356. EXTERN_API( OSErr )
  357. CloseComponentResFile            (short                     refnum)                                TWOWORDINLINE(0x7018, 0xA82A);
  358.  
  359. EXTERN_API( OSErr )
  360. GetComponentResource            (Component                 aComponent,
  361.                                  OSType                 resType,
  362.                                  short                     resID,
  363.                                  Handle *                theResource)                        TWOWORDINLINE(0x7035, 0xA82A);
  364.  
  365. EXTERN_API( OSErr )
  366. GetComponentIndString            (Component                 aComponent,
  367.                                  Str255                 theString,
  368.                                  short                     strListID,
  369.                                  short                     index)                                TWOWORDINLINE(0x7036, 0xA82A);
  370.  
  371. EXTERN_API( Component )
  372. ResolveComponentAlias            (Component                 aComponent)                            TWOWORDINLINE(0x7020, 0xA82A);
  373.  
  374. /********************************************************
  375. * Component Instance Management routines
  376. ********************************************************/
  377. EXTERN_API( Handle )
  378. GetComponentInstanceStorage        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700C, 0xA82A);
  379.  
  380. EXTERN_API( void )
  381. SetComponentInstanceStorage        (ComponentInstance         aComponentInstance,
  382.                                  Handle                 theStorage)                            TWOWORDINLINE(0x700D, 0xA82A);
  383.  
  384. EXTERN_API( long )
  385. GetComponentInstanceA5            (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700E, 0xA82A);
  386.  
  387. EXTERN_API( void )
  388. SetComponentInstanceA5            (ComponentInstance         aComponentInstance,
  389.                                  long                     theA5)                                TWOWORDINLINE(0x700F, 0xA82A);
  390.  
  391. EXTERN_API( long )
  392. CountComponentInstances            (Component                 aComponent)                            TWOWORDINLINE(0x7013, 0xA82A);
  393.  
  394. /* useful helper routines for convenient method dispatching */
  395. EXTERN_API( long )
  396. CallComponentFunction            (ComponentParameters *    params,
  397.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  398.  
  399. EXTERN_API( long )
  400. CallComponentFunctionWithStorage (Handle                 storage,
  401.                                  ComponentParameters *    params,
  402.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  403.  
  404. #if TARGET_CPU_PPC && TARGET_OS_MAC
  405. EXTERN_API( long )
  406. CallComponentFunctionWithStorageProcInfo (Handle         storage,
  407.                                  ComponentParameters *    params,
  408.                                  ProcPtr                 func,
  409.                                  long                     funcProcInfo);
  410.  
  411. #else
  412. #define CallComponentFunctionWithStorageProcInfo(storage, params, func, funcProcInfo ) CallComponentFunctionWithStorage(storage, params, func)
  413.  
  414. #endif  /* TARGET_CPU_PPC && TARGET_OS_MAC */
  415.  
  416. EXTERN_API( long )
  417. DelegateComponentCall            (ComponentParameters *    originalParams,
  418.                                  ComponentInstance         ci)                                    TWOWORDINLINE(0x7024, 0xA82A);
  419.  
  420. EXTERN_API( OSErr )
  421. SetDefaultComponent                (Component                 aComponent,
  422.                                  short                     flags)                                TWOWORDINLINE(0x701E, 0xA82A);
  423.  
  424. EXTERN_API( ComponentInstance )
  425. OpenDefaultComponent            (OSType                 componentType,
  426.                                  OSType                 componentSubType)                    TWOWORDINLINE(0x7021, 0xA82A);
  427.  
  428. EXTERN_API( OSErr )
  429. OpenADefaultComponent            (OSType                 componentType,
  430.                                  OSType                 componentSubType,
  431.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702E, 0xA82A);
  432.  
  433. EXTERN_API( Component )
  434. CaptureComponent                (Component                 capturedComponent,
  435.                                  Component                 capturingComponent)                    TWOWORDINLINE(0x701C, 0xA82A);
  436.  
  437. EXTERN_API( OSErr )
  438. UncaptureComponent                (Component                 aComponent)                            TWOWORDINLINE(0x701D, 0xA82A);
  439.  
  440. EXTERN_API( long )
  441. RegisterComponentResourceFile    (short                     resRefNum,
  442.                                  short                     global)                                TWOWORDINLINE(0x7014, 0xA82A);
  443.  
  444. EXTERN_API( OSErr )
  445. GetComponentIconSuite            (Component                 aComponent,
  446.                                  Handle *                iconSuite)                            TWOWORDINLINE(0x7029, 0xA82A);
  447.  
  448.  
  449. /********************************************************
  450. *                                                        *
  451. *              Direct calls to the Components                *
  452. *                                                        *
  453. ********************************************************/
  454. /* Old style names*/
  455.  
  456. EXTERN_API( long )
  457. ComponentFunctionImplemented    (ComponentInstance         ci,
  458.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  459.  
  460. EXTERN_API( long )
  461. GetComponentVersion                (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  462.  
  463. EXTERN_API( long )
  464. ComponentSetTarget                (ComponentInstance         ci,
  465.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  466.  
  467. /* New style names*/
  468.  
  469. EXTERN_API( ComponentResult )
  470. CallComponentOpen                (ComponentInstance         ci,
  471.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFF, 0x7000, 0xA82A);
  472.  
  473. EXTERN_API( ComponentResult )
  474. CallComponentClose                (ComponentInstance         ci,
  475.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFE, 0x7000, 0xA82A);
  476.  
  477. EXTERN_API( ComponentResult )
  478. CallComponentCanDo                (ComponentInstance         ci,
  479.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  480.  
  481. EXTERN_API( ComponentResult )
  482. CallComponentVersion            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  483.  
  484. EXTERN_API( ComponentResult )
  485. CallComponentRegister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFB, 0x7000, 0xA82A);
  486.  
  487. EXTERN_API( ComponentResult )
  488. CallComponentTarget                (ComponentInstance         ci,
  489.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  490.  
  491. EXTERN_API( ComponentResult )
  492. CallComponentUnregister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFF9, 0x7000, 0xA82A);
  493.  
  494. EXTERN_API( ComponentResult )
  495. CallComponentGetMPWorkFunction    (ComponentInstance         ci,
  496.                                  ComponentMPWorkFunctionUPP * workFunction,
  497.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0xFFF8, 0x7000, 0xA82A);
  498.  
  499.  
  500. #if !TARGET_OS_MAC
  501. /* 
  502.         CallComponent is used by ComponentGlue routines to manually call a component function.
  503.      */
  504. EXTERN_API( ComponentResult )
  505. CallComponent                    (ComponentInstance         ci,
  506.                                  ComponentParameters *    cp);
  507.  
  508. #endif  /* !TARGET_OS_MAC */
  509.  
  510. /* UPP call backs */
  511. enum { uppComponentMPWorkFunctionProcInfo = 0x000003F0 };         /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  512. enum { uppComponentRoutineProcInfo = 0x000003F0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  513. #define NewComponentMPWorkFunctionProc(userRoutine)             (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture())
  514. #define NewComponentRoutineProc(userRoutine)                     (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture())
  515. #define CallComponentMPWorkFunctionProc(userRoutine, globalRefCon, header)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentMPWorkFunctionProcInfo, (globalRefCon), (header))
  516. #define CallComponentRoutineProc(userRoutine, cp, componentStorage)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentRoutineProcInfo, (cp), (componentStorage))
  517. /* ProcInfos */
  518.  
  519. /* MixedMode ProcInfo constants for component calls */
  520. enum {
  521.     uppComponentFunctionImplementedProcInfo            = 0x000002F0,
  522.     uppGetComponentVersionProcInfo                    = 0x000000F0,
  523.     uppComponentSetTargetProcInfo                    = 0x000003F0,
  524.     uppCallComponentOpenProcInfo                    = 0x000003F0,
  525.     uppCallComponentCloseProcInfo                    = 0x000003F0,
  526.     uppCallComponentCanDoProcInfo                    = 0x000002F0,
  527.     uppCallComponentVersionProcInfo                    = 0x000000F0,
  528.     uppCallComponentRegisterProcInfo                = 0x000000F0,
  529.     uppCallComponentTargetProcInfo                    = 0x000003F0,
  530.     uppCallComponentUnregisterProcInfo                = 0x000000F0,
  531.     uppCallComponentGetMPWorkFunctionProcInfo        = 0x00000FF0
  532. };
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540. #if PRAGMA_STRUCT_ALIGN
  541.     #pragma options align=reset
  542. #elif PRAGMA_STRUCT_PACKPUSH
  543.     #pragma pack(pop)
  544. #elif PRAGMA_STRUCT_PACK
  545.     #pragma pack()
  546. #endif
  547.  
  548. #ifdef PRAGMA_IMPORT_OFF
  549. #pragma import off
  550. #elif PRAGMA_IMPORT
  551. #pragma import reset
  552. #endif
  553.  
  554. #ifdef __cplusplus
  555. }
  556. #endif
  557.  
  558. #endif /* __COMPONENTS__ */
  559.  
  560.